import _axios from "@/utils/requestUtil";
import _urlConfig from "@/config/OrderURLConfig";
class Order {

  /**
   *1.确认订单，查看购物车选中的商品
   */
  getOrderItemByCart() {
    return _axios.request({
      url: _urlConfig.getOrderItemByCart,
      method: "post"
    });
  }

  /**
   * 2.获取订单列表
   * @param {*} data
   * pageNum:页数
   * pageSize：页面大小
   */
  orderList(data) {
    return _axios.request({
        url: _urlConfig.orderList,
        data: data,
        method: "post"
      });
  }

  /**
   * 
   * @param {*} shippingId 
   * shippingId:收货地址id
   */
  createOrder(shippingId){
    return _axios.request({
        url: _urlConfig.createOrder,
        data: {
            shippingId:shippingId
        },
        method: "post"
      });
  }
}
export default Order;
